package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.LikeTravel;
import cn.wolfcode.trip.base.mapper.LikeTravelMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.ILikeMessageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LikeMessageServiceImpl implements ILikeMessageService {
    @Autowired
     private LikeTravelMapper likeTravelMapper;


    @Override
    public PageInfo<LikeTravel> query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<LikeTravel> list=likeTravelMapper.selectForList(qo);
        return new PageInfo<LikeTravel>(list);
    }

    @Override
    public Integer queryLikeCount(Long uid) {
        Integer count = likeTravelMapper.listLikeCountByStatus(uid);
        return count;
    }

    @Override
    public Integer everyLikeCount(Long uid) {
        likeTravelMapper.listEveryCount(uid);
        return null;
    }

    @Override
    public void changeStatus(Long uid) {
        likeTravelMapper.changeStatus(uid);
    }
}
